<?php

/**
 * action form base class.
 *
 * @method action getObject() Returns the current form's model object
 *
 * @package    e-DSL
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseactionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                     => new sfWidgetFormInputHidden(),
      'wfmodele_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('wfmodele'), 'add_empty' => true)),
      'description'            => new sfWidgetFormInputText(),
      'ordre'                  => new sfWidgetFormInputText(),
      'etatorigine_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('etatorigine'), 'add_empty' => false)),
      'etatdestine_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('etatdestine'), 'add_empty' => false)),
      'role_acteur_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('role_acteur'), 'add_empty' => false)),
      'commentaire'            => new sfWidgetFormTextarea(),
      'debutTraitement'        => new sfWidgetFormInputCheckbox(),
      'finTraitement'          => new sfWidgetFormInputCheckbox(),
      'fermetechnique'         => new sfWidgetFormInputCheckbox(),
      'fermedemande'           => new sfWidgetFormInputCheckbox(),
      'recalculedelai'         => new sfWidgetFormInputCheckbox(),
      'readOnly'               => new sfWidgetFormInputCheckbox(),
      'commentaireObligatoire' => new sfWidgetFormInputCheckbox(),
      'champsModifier'         => new sfWidgetFormInputText(),
      'icon'                   => new sfWidgetFormInputText(),
      'addAttach'              => new sfWidgetFormInputCheckbox(),
      'sansmails'              => new sfWidgetFormInputCheckbox(),
      'rolesNotification'      => new sfWidgetFormInputText(),
      'messageClient'          => new sfWidgetFormTextarea(),
      'dossierAutomatique_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('dossierAutomatique'), 'add_empty' => true)),
      'messageUtilisateur'     => new sfWidgetFormTextarea(),
      'created_at'             => new sfWidgetFormDateTime(),
      'updated_at'             => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                     => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'wfmodele_id'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('wfmodele'), 'required' => false)),
      'description'            => new sfValidatorString(array('max_length' => 100)),
      'ordre'                  => new sfValidatorInteger(),
      'etatorigine_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('etatorigine'))),
      'etatdestine_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('etatdestine'))),
      'role_acteur_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('role_acteur'))),
      'commentaire'            => new sfValidatorString(array('required' => false)),
      'debutTraitement'        => new sfValidatorBoolean(array('required' => false)),
      'finTraitement'          => new sfValidatorBoolean(array('required' => false)),
      'fermetechnique'         => new sfValidatorBoolean(array('required' => false)),
      'fermedemande'           => new sfValidatorBoolean(array('required' => false)),
      'recalculedelai'         => new sfValidatorBoolean(array('required' => false)),
      'readOnly'               => new sfValidatorBoolean(array('required' => false)),
      'commentaireObligatoire' => new sfValidatorBoolean(array('required' => false)),
      'champsModifier'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'icon'                   => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'addAttach'              => new sfValidatorBoolean(array('required' => false)),
      'sansmails'              => new sfValidatorBoolean(array('required' => false)),
      'rolesNotification'      => new sfValidatorPass(array('required' => false)),
      'messageClient'          => new sfValidatorString(array('required' => false)),
      'dossierAutomatique_id'  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('dossierAutomatique'), 'required' => false)),
      'messageUtilisateur'     => new sfValidatorString(array('required' => false)),
      'created_at'             => new sfValidatorDateTime(),
      'updated_at'             => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('action[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'action';
  }

}
